import { ref } from 'vue';
import { cloneDeep } from 'lodash-es';

export default function useResetTableRef<T>(value: T) {
  const initValue = cloneDeep(value);
  const state = ref<T>(value);
  const reset = () => {
    state.value = cloneDeep(initValue);
  };
  return [state, reset];
}
